package _b.fengzhuang;

public class Student {

    private String name;
    private String sno;
    private int age;

    public Student(String name, String sno) {
        this.name = name;
        this.sno = sno;
    }

    public Student(String name, String sno, int age) {
        this.name = name;
        this.sno = sno;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age < 0) {
            System.out.println("年龄错误");
        }else {
            this.age = age;
        }
    }
}
